# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import xadmin
from xadmin import views

from .models import EmailVerifyRecord, Banner

# Register your models here.


# class Admin(object):
# 	list_display = ['', '', '', '', '', '', '']
# 	search_fields = []
# 	list_filter = []
#
#
# xadmin.site.register()


class BaseSetting(object):
	enable_themes = True  # 主题
	use_bootswatch = True  # 主题菜单


class GlobalSettings(object):
	site_title = u'在线教育后台管理系统'
	site_footer = u'2018 ATPuper(在线教育) All Rights Reserved'
	menu_style = 'accordion'  # 菜单风格，可设置为可折叠


class EmailVerifyRecordAdmin(object):
	list_display = ['code', 'email', 'send_type', 'send_time']
	search_fields = ['code', 'email']
	list_filter = ['code', 'email', 'send_type', 'send_time']


class BannerAdmin(object):
	list_display = ['status', 'title', 'image', 'href', 'index', 'create_time', 'updata_time']
	search_fields = ['status', 'title', 'image', 'href', 'index']
	list_filter = ['status', 'title', 'image', 'href', 'index', 'create_time', 'updata_time']


xadmin.site.register(views.BaseAdminView, BaseSetting)  # 注册基本设置，如主题
xadmin.site.register(views.CommAdminView, GlobalSettings)  # 注册基本设置，如主题
xadmin.site.register(EmailVerifyRecord, EmailVerifyRecordAdmin)
xadmin.site.register(Banner, BannerAdmin)
